package com.wangyadong.hobby.schedule.jobtask.jvm.OOM;

import java.util.stream.IntStream;

public class JavaVMStackSOF {
    private int stackLength = 1;

    public void stackLeak() {
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) {
        IntStream.range(0, 10).forEach(i -> {
            new Thread(()->{
                JavaVMStackSOF javaVMStackSOF = new JavaVMStackSOF();
                try {
                    javaVMStackSOF.stackLeak();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }).start();
        });



    }
}
